﻿using System.Collections.Generic;
using Omniscient.TimeTracker.BusinessModel;
using Omniscient.TimeTracker.Data;
using Omniscient.Foundation.ApplicationModel;
using Omniscient.Foundation.Data;
using System.Security.Permissions;

namespace Omniscient.TimeTracker.Server
{
    public class ResourceService : IResourceService
    {
        #region IResourceService Members

        public EntityList<Resource> GetResources()
        {
            IEntityAdapter<Resource> adapter = ApplicationManager.Current.ObjectContainer.Get<IEntityAdapter<Resource>>();

            if (adapter != null)
            {
                return adapter.LoadAll();
                //TODO: Put list of resource into the cache
            }
            return null;
        }

        #endregion
    }
}
